Skip to content

Conversation

@kpatel71716
Copy link
Collaborator

@kpatel71716 kpatel71716 commented Oct 30, 2025

Description

CLOUDP-335390 As part of the effort to rename Atlas Stream Processing Instances to Workspaces, we are adding a new stream_workspace resource/datasource to replace stream_instance

Link to any related issue(s):

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@kpatel71716 kpatel71716 changed the title feat: add stream_workspace resource + ds to replace stream_instance feat: Add stream_workspace resource + ds to replace stream_instance Oct 30, 2025
@kpatel71716
Copy link
Collaborator Author

kpatel71716 commented Oct 31, 2025

Please review by individual commit to filter out all the docs updates. My thought was that we can take an initial approach to convert the stream workspace model to the stream instance model and back to reduce code duplication. Happy to take a different approach if the team does not feel comfortable with this approach

As a follow-up to this PR we can consider refactoring this approach, but for now I felt it provides functionality without making the PR too complex. I mostly copied over a lot of the stream instance code to achieve the addition of the new resource and datasource

@kpatel71716 kpatel71716 marked this pull request as ready for review October 31, 2025 13:20
@kpatel71716 kpatel71716 requested review from a team as code owners October 31, 2025 13:20
@github-actions
Copy link
Contributor

APIx bot: a message has been sent to Docs Slack channel

Copy link
Collaborator

@xargom xargom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Collaborator Author

@kpatel71716 kpatel71716 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added logical commits to refactor the docs, simplify var naming that was copy/pasted over + remove copied unused methods, and refactored the workspace/instance struct mapping logic for a better intermediate solution as we transition

@@ -0,0 +1,175 @@
package streamworkspace

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filenames should not have the resource name. New convention similar to streamprocessor instead (remove stream_workspace from the name)

Copy link
Collaborator

@EspenAlbert EspenAlbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Thank you for addressing the comments 👏

@@ -1,10 +1,20 @@
# DEPRECATED: This example uses the deprecated mongodbatlas_stream_instance resource.
# For new deployments, use mongodbatlas_stream_workspace instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider removing examples entirely for deprecated resources to avoid customer confusion

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, done! I have CLOUDP-347566 to do this more extensively as a quick follow-up to reduce noise in this PR


func ResourceSchema(ctx context.Context) schema.Schema {
return schema.Schema{
DeprecationMessage: fmt.Sprintf(constant.DeprecationNextMajorWithReplacementGuide, "resource", "mongodbatlas_stream_workspace", "https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/stream-instance-to-stream-workspace-migraton-guide"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: consider fixing the docs version in the URL to protect from guide url renames in future versions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, added this as part of CLOUDP-347566 as a quick follow-up

"go.mongodb.org/atlas-sdk/v20250312009/admin"
)

// newStreamWorkspaceCreateReq creates an API request for creating a stream workspace
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// newStreamWorkspaceCreateReq creates an API request for creating a stream workspace
// newStreamWorkspaceCreateReq creates an API request for creating a stream workspace.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done on this and other comments in code!

if resp.Diagnostics.HasError() {
return
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: my preference is not to have so many empty lines, similar for other functions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, reduced the new lines here

@kpatel71716
Copy link
Collaborator Author

Failing test unrelated and we have been investigating and fixing some flakiness. Merging

@kpatel71716 kpatel71716 merged commit 83f18af into master Nov 11, 2025
49 of 50 checks passed
@kpatel71716 kpatel71716 deleted the CLOUDP-335390_2 branch November 11, 2025 00:47
svc-apix-Bot added a commit that referenced this pull request Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants